/*

 */
package com.insigma.business.qrcode.common.template;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;


public class DataCache {
    public final Logger logger = LoggerFactory.getLogger(getClass());

    private static DataCache dataCache = new DataCache();

    private Map<String, Object> dataMap = new ConcurrentHashMap<String, Object>();

    private DataCache() {
    }

    public static DataCache getInstance() {
        return dataCache;
    }


    Properties getCommonProperties(String propFileName) {
        return (Properties) dataMap.get(propFileName);
    }

    void setCommonProperties(String propFileName, Properties properties) {
        dataMap.put(propFileName, properties);
    }


    Object getCommonValue(String key) {
        return dataMap.get(key);
    }

    void setCommonValue(String key, Object obj) {
        this.dataMap.put(key, obj);
    }

    void removeCommonValue(String key) {
        this.dataMap.remove(key);
    }

}
